<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>命名插槽的使用</title>
</head>
<body>
<div id="app">
    <cpn>
        <template v-slot:left>
            <button>按钮</button>
        </template>
    </cpn>

    <hr>
    <cpn>
        <template v-slot:left>
            <button>左边</button>
        </template>
        <template v-slot:center>
            <button>中间</button>
        </template>
        <template v-slot:right>
            <button>右边</button>
        </template>
    </cpn>

</div>

<template id="cpn">
    <slot name="left">
        <div>left</div>
    </slot>
    <slot name="center">
        <div>center</div>
    </slot>
    <slot name="right">
        <div>right</div>
    </slot>
</template>

<script type="module">
    import {createApp} from "../../../../js/vue.esm-browser.js";
    import {defineComponent} from "../../../../js/vue.esm-browser.js";

    let cpn = defineComponent(
        {
            template: "#cpn"
        }
    );

    let app = createApp({
        setup() {
            return {}
        },
        components: {
            cpn
        }
    })

    app.mount("#app")
</script>
</body>
</html>